Repository navigation
ci: cancel PR runs only for new commits - #129
Merged
Merged
Conversation
A newer run on the same commit (e.g. for an edit of the description) cancelled the run in progress, and its failed gate then blocked the merge. Only the first attempt of a run for a pull request's synchronize action now cancels runs in progress, as in "Cancelled runs" of actions/gate/README.md in elixir-cloud-aai/.github. Part of elixir-cloud-aai/.github#73 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011FSoqMpmDCfbACLj3uy6xV
Documentation build overview
No files changed. |
uniqueg
marked this pull request as ready for review
November 10, 2026 20:03
Contributor
Reviewer's GuideConfigurationUpdate CI concurrency groups so push runs are keyed by commit and only a first-attempt pull-request synchronize run cancels in-progress runs.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/ci.yml" line_range="27-30" />
<code_context>
- cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+ group: >-
+ ci-${{ github.event_name == 'push' && github.sha || github.ref }}
+ cancel-in-progress: >-
+ ${{ github.event_name == 'pull_request'
+ && github.event.action == 'synchronize'
+ && github.run_attempt == 1 }}
jobs:
</code_context>
<issue_to_address>
**Invalid bot-PR title can pass**
When a user edits a Dependabot PR title while another run occupies its concurrency group, then edits the PR body before title validation starts, the body-edit run replaces the pending title-validation run; `title` is skipped by its condition and `passed` allows that skip, so the gate succeeds without validating the new title and the invalid title can merge.
Prevent later body-edit runs from replacing required title-validation runs, or make those runs validate the current title.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: .github/workflows/ci.yml:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Only a new head commit of a pull request now cancels its CI runs in progress:
cancel-in-progressof the workflow-levelconcurrencyblock in.github/workflows/ci.ymlis true only forpull_requestwith actionsynchronizeon the first attempt, as in "Cancelled runs" ofactions/gate/README.mdin elixir-cloud-aai/.github (elixir-cloud-aai/.github#71):Before, a newer run on the same commit (e.g. for editing the description, also by Sourcery, or marking the pull request ready) cancelled the run in progress, and its failed
CI passedwas then the newest result on the commit, which blocked the merge (elixir-cloud-aai/.github#70). Runs for other actions, and reruns, now wait for the run in progress instead; a waiting run that is replaced starts no job, so it leaves no check. The gate keepsif: always(), so a needed job that failed or was cancelled still fails it. This pull request's own runs already use the new rule.Runs for pushes to
mainnow also get a group of their own (github.sha), as in the README, so that a waiting push run is no longer replaced by a newer one; pull request runs keep the group per ref. A comment above the block describes the rule.Part of elixir-cloud-aai/.github#73
Verification
.github/workflows/ci.yml: passed.CI passed, on e3ea8c7.Light lane: changes only the CI workflow's concurrency settings (no secrets, permissions or release workflow); I reviewed the diff myself.
Declined review findings
None.
Open questions
None.
🤖 Generated with Claude Code
https://claude.ai/code/session_011FSoqMpmDCfbACLj3uy6xV
Summary by Sourcery
Ensure CI cancellation is limited to new pull-request commits while preserving independent push runs and reliable merge checks.
Bug Fixes:
CI passedchecks from blocking merges.Enhancements:
CI: